import request from "../utils/request";

// 分页查询商品列表
export const commodityPage = data => {
    return request({
        method: 'POST',
        url: '/good/findPage',
        data
    })
}
// 新增商品
export const commodityAdd = data => {
    return request({
        method: 'POST',
        url: '/good/save',
        data
    })
}
// 编辑商品
export const commodityEdit = data => {
    return request({
        method: 'POST',
        url: '/good/edit',
        data
    })
}
//查询商品
export const commodityById = id => {
    return request({
        method: 'GET',
        url: '/good/findById?id=' + id
    })
}
// 商品属性列表
export const attribute = name => {
    return request({
        method: 'GET',
        url: '/attribute/findAll?name=' + name
    })
}
// 新增商品属性
export const addAttribute = data => {
    return request({
        method: 'POST',
        url: '/attribute/save',
        data
    })
}
// 查看商品属性
export const attributeSee = id => {
    return request({
        method: 'GET',
        url: '/attribute/findById?id=' + id
    })
}
//编辑商品属性
export const editAttribute = data => {
    return request({
        method: 'POST',
        url: '/attribute/edit',
        data
    })
}
// 价格本分页
export const priceBookList = data => {
    return request({
        method:'POST',
        url:'/priceThis/findPage',
        data
    })
}
// 新增价格本
export const addPriceBook = data => {
    return request({
        method:'POST',
        url:'/priceThis/save',
        data
    })
}
// 查看详情
export const detailsPriceBook = id => {
    return request({
        method:'GET',
        url:'/priceThis/findById?id='+ id
    })
}
//编辑价格本
export const editPriceBook = data => {
    return request({
        method:'POST',
        url:'/priceThis/edit',
        data
    })
}
// 删除价格本
export const deletePriceBook = id => {
    return request({
        method:'GET',
        url:'/priceThis/deleteById?id='+ id
    })
}
